package dataobj;
import java.text.*;
import java.util.*;

/***
 * Set and return the course information including the course name, code, session, number, venue, instructor's name, credits, starting and ending time and date and the week day.
 */
public class CourseTO{
	private String name;
	private String code;
	private String session;
	private String crn;
	private String venue;
	private String instructor;
	private Double credits;
	private Date startTime;
	private Date endTime;
	private Date startDate;
	private Date endDate;
	private int weekDay;
	
	/***
	 * Return the course name.
	 * @return		the course name
	 */
	public String getName() {
		return name;
	}
	
	/***
	 * Set the course name.
	 * @param name	the course name
	 */
	public void setName(String name) {
		this.name = name;
	}
	
	/***
	 * Return the course code.
	 * @return		the course code
	 */
	public String getCode() {
		return code;
	}
	
	/***
	 * Set the course code.
	 * @param code	the course code
	 */
	public void setCode(String code) {
		this.code = code;
	}
	
	/***
	 * Return the course session.
	 * @return		the course session
	 */
	public String getSession() {
		return session;
	}
	
	/***
	 * Set the course session.
	 * @param session	course session
	 */
	public void setSession(String session) {
		this.session = session;
	}
	
	/***
	 * Return the course number.
	 * @return		the course number
	 */
	public String getCrn() {
		return crn;
	}
	
	/***
	 * Set the course number.
	 * @param crn	the course number
	 */
	public void setCrn(String crn) {
		this.crn = crn;
	}
	
	/***
	 * Return the venue.
	 * @return		the venue
	 */
	public String getVenue() {
		return venue;
	}
	
	/***
	 * Set the venue.
	 * @param venue	the venue
	 */
	public void setVenue(String venue) {
		this.venue = venue;
	}
	
	/***
	 * Return the course instructor's name.
	 * @return		the course instructor's name
	 */
	public String getInstructor() {
		return instructor;
	}
	
	/***
	 * Set the course instructor's name.
	 * @param instructor	the course instructor's name
	 */
	public void setInstructor(String instructor) {
		this.instructor = instructor;
	}
	
	/***
	 * Return the credits.
	 * @return		the credits
	 */
	public Double getCredits() {
		return credits;
	}
	
	/***
	 * Set the credits.
	 * @param credits	the credits
	 */
	public void setCredits(Double credits) {
		this.credits = credits;
	}
	
	/***
	 * Return the starting time of the course.
	 * @return the starting time of the course
	 */
	public Date getStartTime() {
		return startTime;
	}
	
	/***
	 * Set the starting time of the course.
	 * @param startTime	the starting time of the course
	 */
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	
	/***
	 * Return the ending time of the course.
	 * @return		the ending time of the course
	 */
	public Date getEndTime() {
		return endTime;
	}
	
	/***
	 * Set the ending time of the course.
	 * @param endTime	the ending time of the course
	 */
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	
	/***
	 * Return the starting date of the course.
	 * @return		the starting date of the course
	 */
	public Date getStartDate() {
		return startDate;
	}
	
	/***
	 * Set the starting date of the course.
	 * @param startDate	the starting date of the course
	 */
	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}
	
	/***
	 * Return the ending date of the course.
	 * @return		the ending date of the course
	 */
	public Date getEndDate() {
		return endDate;
	}
	
	/***
	 * Set the ending date of the course.
	 * @param endDate	the ending date of the course
	 */
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	
	/***
	 * Return the week day of the course.
	 * @return		the week day of the course
	 */
	public int getWeekDay() {
		return weekDay;
	}
	
	/***
	 * Set the week day of the course.
	 * @param weekDay	the week day of the course
	 */
	public void setWeekDay(int weekDay) {
		this.weekDay = weekDay;
	}

	/***
	 * Return the formated course information.
	 */
	@Override
	public String toString(){
		DateFormat dateFormat = new SimpleDateFormat("hh:mm a", Locale.ENGLISH);
		return "Code: "+code+" - "+session+"\n"
				+"Name: "+name+"\n"
				+"Instructor: "+instructor+"\n"
				+"Venue: "+venue+"\n"
				+"Time: "+dateFormat.format(startTime)+" - "+dateFormat.format(endTime)+"\n"
				+"Weekday: "+new DateFormatSymbols(Locale.ENGLISH).getWeekdays()[weekDay]+"\n";
	}

}
